package iedcyt.acute.controller;

import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Listener;

import iedcyt.acute.controller.listener.jcrUpdate.JcrFieldListener;
import iedcyt.acute.controller.listeners.configuration.*;
import iedcyt.acute.model.ConfigurationModel;
import iedcyt.acute.model.JCRFieldModel;
import iedcyt.acute.view.ConfigurationView;
import iedcyt.acute.view.JCRFieldView;

/**
 * @author 53418015d
 *
 */
public class JCRFieldController {

	private JCRFieldView _view;
	private JCRFieldModel _model;
	
	/**
	 * @param view
	 */
	public JCRFieldController(JCRFieldView view) {
		_view = view;
		_model = new JCRFieldModel();
	}
	
	/**
	 * 
	 */
	public void iniView() {
		_model.setChanged(false);
		//_view.setShell(_model.getProperties());
		_view.moveLocalShellToCenter();
		_view.openWindow();
	}
	
			
	/**
	 * @return los campos de la tabla para actualizar el jcr
	 */
	public String[] getNewFields(){
		return _model.getNewFields();
	}

	/**
	 * @return los campos de la tabla JCR
	 */
	public String[] getJcrFields() {
		
		return _model.getJcrFields();
	}

	/**
	 * @return jcrfieldListener
	 */
	public Listener getJcrFieldListener() {
		// TODO Auto-generated method stub
		return new JcrFieldListener(_view, _model);
	}
}
